regex for numbers + dot in javascript

102

regex for numbers + dot in javascript -

// javascript regex for numbers and dot ex : 2.2
function validate(s) {
    var rgx = /^[0-9]*\.?[0-9]*$/;
    return s.match(rgx);
}

Comments

Submit
0 Comments